<template>
	<view class="content">
		<view class="too">
			<view class="too">
				<view class="toop">
					<image :src="data.shops.photo" mode=""></image>
					<view class="toop_a">
						<view class="toop_aa">
							<p class="toopp_a">{{ data.shops.title }}</p>
							<p class="toopp_b">全部宝贝 {{ data.shops.dotey }} 浏览量 {{ data.shops.views }}</p>
							<view class="toopp_c">
								<view class="toopp_ca r">{{ data.shops.type }}</view>
								<!-- <view class="toopp_cb r">{{data.shops.type}}</view> -->
							</view>
						</view>
						<view class="toop_ab r" @click="inTheShop(data.shops.id)">进店逛逛</view>
					</view>
				</view>
			</view>
		</view>
		<view class="zhuanshi" style="margin-bottom: 150rpx;">
			<view class="zhuanshi_a">{{ data.product.title }}</view>
			<view class="zhuanshi_b">
				<view class="zhuanshi_b_a">{{ data.product.act_time }}</view>
				<view class="zhuanshi_b_a">阅读{{ data.product.views }}</view>
			</view>
			<view class="zhuanshi_c r">
				<p>案例总价:¥ {{ data.product.money }}</p>
				<p>活动时间:{{ data.product.act_time }}</p>
				<p>活动类型:{{ data.product.act_type }}</p>
			</view>
			<view class="neirong_b">{{ data.product.content }}</view>
			<view
				v-for="(item, index) in data.product.content_img"
				:key="index"
				style="display: flex; flex-direction: column; justify-content: center; align-items: center;"
			>
				<image :src="item" mode="aspectFill" @click="preview(item)" style="margin-bottom: 15rpx;"></image>
			</view>
		</view>

		<view class="bottom_a"><view class="bottom_a_a" @click="dialNum(data.shops.phone)">拨打电话</view></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			sid: '', // 店铺id
			id: '', // 案例id
			data: {},
		};
	},
	onLoad(e) {
		console.log('e :>> ', e);
		e && (this.id = e.id);
		e && (this.sid = e.sid);
		this.cseDetails(e);
		uni.setNavigationBarColor({
			frontColor: '#ffffff',
			backgroundColor: '#ff0000',
			animation: {
				duration: 400,
				timingFunc: 'easeIn',
			},
		});
	},
	methods: {
		dialNum(phone) {
			uni.makePhoneCall({
				phoneNumber: phone,
			});
		},
		inTheShop(id) {
			uni.navigateTo({
				url: 'gonsi_Home?id=' + id,
			});
		},
		preview(urls) {
			uni.previewImage({
				urls: [urls],
				longPressActions: {
					itemList: ['发送给朋友', '保存图片', '收藏'],
					success: function(data) {
						console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
					},
					fail: function(err) {
						console.log(err.errMsg);
					},
				},
			});
		},
		/* 活动案例详情 */
		async cseDetails(e) {
			let obj = {
				sid: e.sid,
				aid: e.id,
			};
			const res = await this.$u.post('api/shop/shop_list_details', obj, {});
			if (!res.code) return uni.$showMsg();
			this.data = res.data;
			console.log('活动案例详情 >>  ', res);
		},
	},
};
</script>

<style lang="scss" scoped>
.content {
	width: 100%;
	height: 100vh;
	overflow: scroll;
	background-color: #f5f8fd;
}
.too {
	width: 100%;

	background-color: #ffffff;
	.toop {
		width: 690rpx;
		margin: auto;

		display: flex;
		padding: 30rpx 0;
		image {
			width: 100rpx;
			height: 100rpx;
			border-radius: 50rpx;
		}
		.toop_a {
			width: 590rpx;

			display: flex;

			.toop_aa {
				width: 440rpx;

				.toopp_a {
					width: 420rpx;
					height: 35rpx;
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 600;
					color: #333333;
					line-height: 35rpx;
					margin-left: 10rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
				.toopp_b {
					width: 440rpx;
					font-size: 24rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #999999;
					line-height: 60rpx;
					margin-left: 10rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
				.toopp_c {
					width: 400rpx;
					height: 30rpx;
					display: flex;
					margin-left: 10rpx;
					.toopp_ca {
						display: flex;
						justify-content: center;
						align-items: center;
						width: 120rpx;
						height: 33rpx;
						border: 1rpx solid #ff1a14;
						color: #ff1a14;
						font-size: 24rpx;
						text-align: center;
					}
					.toopp_cb {
						display: flex;
						justify-content: center;
						align-items: center;
						width: 120rpx;
						height: 33rpx;
						border: 1rpx solid #ff1a14;
						color: #ff1a14;
						font-size: 24rpx;
						text-align: center;
						margin-left: 20rpx;
					}
				}
			}
			.toop_ab {
				width: 150rpx;
				height: 50rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				border: 1rpx solid #ff1a14;
				color: #ff1a14;

				font-size: 30rpx;
			}
		}
	}
}
.zhuanshi {
	width: 100%;
	height: 100%;
	background-color: #ffffff;
	margin-top: 30rpx;
	.zhuanshi_a {
		font-weight: 500;
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		color: #333333;
		font-size: 30rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.zhuanshi_b {
		width: 690rpx;
		margin: auto;
		height: 40rpx;
		display: flex;
		justify-content: space-between;
		.zhuanshi_b_a {
			height: 40rpx;
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #999999;
			line-height: 40rpx;
		}
	}
	.neirong_b {
		width: 690rpx;
		margin: 0 auto;
		margin-top: 25rpx;

		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #333333;
		line-height: 36rpx;
	}
	.zhuanshi_c {
		width: 690rpx;
		margin: auto;
		height: 160rpx;
		background-color: #f5f8fd;
		margin-top: 10rpx;
		box-shadow: 0px 0px 6px 0px rgba(13, 21, 28, 0.1);
		p {
			font-weight: 500;
			width: 650rpx;
			height: 50rpx;
			line-height: 50rpx;
			margin-left: 20rpx;
			color: #333333;
			font-size: 28rpx;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}
	.zhuanshi_d {
		width: 690rpx;
		margin: auto;
		height: 100%;
		margin-top: 40rpx;
	}
}

.bottom_a {
	width: 100%;
	height: 110rpx;
	background-color: #ffffff;
	position: fixed;
	bottom: 0;
	.bottom_a_a {
		font-size: 36rpxp;
		width: 690rpx;
		margin: auto;
		border-radius: 50rpx;
		background-color: #ff0000;
		height: 90rpx;
		line-height: 90rpx;
		margin-top: 10rpx;
		color: #ffffff;
		text-align: center;
	}
}
</style>
